import javax.swing.*;
import java.awt.event.*;

public class ButtonTest implements ActionListener{
	JButton button;
	public static void main(String[] args) {
		ButtonTest test = new ButtonTest();
	}

	public ButtonTest(){
		JFrame frame = new JFrame("ButtonTest");
		button = new JButton("cick me!");

		button.addActionListener(this);

		frame.getContentPane().add(button);
		frame.setSize(300,200);
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		frame.setVisible(true);
	}

	public void actionPerformed(ActionEvent event){
		button.setText("I have been click");
	}
}